{
    class Loader extends Laya.Box {
        constructor () {
            super();
            
            this.bg = null;
            this.ani = null;

            this.init();
        }

        init () {
            this.left = 0;
            this.right = 0;
            this.top = 0;
            this.bottom = 0;
            
            let bg = new Laya.Label();
                bg.left = 0;
                bg.right = 0;
                bg.top = 0;
                bg.bottom = 0;
                bg.bgColor = "#000000";
                bg.alpha = 0.5;

            let ani = new Laya.Label("正在加载中。。。");
                ani.fontSize = 80;
                ani.centerX = 0;
                ani.centerY = 0;
                ani.color = "#ffffff";
            
            this.addChildren(bg, ani);
        }

        onResLoaded (callback) {
            this.removeSelf();
            callback && callback();
        }

        load (assets, callback) {
            Laya.stage.addChild(this);

            Laya.loader.load(assets, Laya.Handler.create(this, this.onResLoaded, [callback]));
        }
    }

    Sail.class(Loader, "Sail.Loader");
}